#!/usr/bin/env python3
# 
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
# Built on top of Unicorn emulator (www.unicorn-engine.org) 

def map_syscall(syscall_num):
    adapter = {
        4001 : "ql_syscall_exit",
        4002 : "ql_syscall_vfork",
        4003 : "ql_syscall_read",
        4004 : "ql_syscall_write",
        4005 : "ql_syscall_open",
        4006 : "ql_syscall_close",
        4010 : "ql_syscall_unlink",
        4011 : "ql_syscall_execve",
        4012 : "ql_syscall_chdir",
        4013 : "ql_syscall_time",
        4019 : "ql_syscall_lseek",
        4020 : "ql_syscall_getpid",
        4023 : "ql_syscall_setuid",
        4024 : "ql_syscall_getuid",
        4027 : "ql_syscall_alarm",
        4033 : "ql_syscall_access",
        4034 : "ql_syscall_nice",
        4042 : "ql_syscall_pipe",
        4045 : "ql_syscall_brk",
        4046 : "ql_syscall_setgid",
        4054 : "ql_syscall_ioctl",
        4055 : "ql_syscall_fcntl",
        4063 : "ql_syscall_dup2",
        4066 : "ql_syscall_setsid",
        4076 : "ql_syscall_ugetrlimit",
        4078 : "ql_syscall_gettimeofday",
        4081 : "ql_syscall_setgroups",
        4085 : "ql_syscall_readlink",
        4090 : "ql_syscall_mmap",
        4091 : "ql_syscall_munmap",
        4092 : "ql_syscall_truncate",
        4093 : "ql_syscall_ftruncate",
        4096 : "ql_syscall_getpriority",
        4106 : "ql_syscall_stat",
        4107 : "ql_syscall_lstat",
        4108 : "ql_syscall_fstat",
        4114 : "ql_syscall_wait4",
        4116 : "ql_syscall_sysinfo",
        4120 : "ql_syscall_clone",
        4122 : "ql_syscall_uname",
        4125 : "ql_syscall_mprotect",
        4140 : "ql_syscall__llseek",
        4142 : "ql_syscall__newselect",
        4146 : "ql_syscall_writev",
        4166 : "ql_syscall_nanosleep",
        4168 : "ql_syscall_accept",
        4169 : "ql_syscall_bind",
        4170 : "ql_syscall_connect",
        4174 : "ql_syscall_listen",
        4181 : "ql_syscall_setsockopt",
        4182 : "ql_syscall_shutdown",
        4183 : "ql_syscall_socket",
        4192 : "ql_syscall_prctl",
        4194 : "ql_syscall_rt_sigaction",
        4195 : "ql_syscall_rt_sigprocmask",
        4203 : "ql_syscall_getcwd",
        4210 : "ql_syscall_mmap2",
        4213 : "ql_syscall_stat64",
        4215 : "ql_syscall_fstat64",
        4220 : "ql_syscall_fcntl64",
        4222 : "ql_syscall_gettid",
        4237 : "ql_syscall_sendfile64",
        4238 : "ql_syscall_futex",
        4246 : "ql_syscall_exit_group",
        4252 : "ql_syscall_set_tid_address",
        4283 : "ql_syscall_mips32_set_thread_area",
        4309 : "ql_syscall_set_robust_list",
    }
    return adapter.get(syscall_num)
